package com.lagou.scala.test.Q3

import java.util.ArrayList


/**
 * 1、对同一个用户，在同一个位置，连续的多条记录进行合并
 * 2、合并原则：开始时间取最早时间，停留时长累计求和
 */
object UserLocation {
  def main(args: Array[String]): Unit = {
    //数据存储数据库，然后直接从表中group by 即可
    def sql = "select user_id, location_id, min(start_time) as start_time, sum(stay_time) as stay_time from t1 group by user_id, location_id"
  }
}
